翻訳と辞書
Words near each other
・ Rational approximation
・ Rational arrival process
・ Rational Asset Manager
・ Rational Automation Framework
・ Rational basis review
・ Rational behavior therapy
・ Rational Business Developer
・ Rational choice institutionalism
・ Rational choice theory
・ Rational choice theory (criminology)
・ Rational ClearCase
・ Rational ClearCase UCM
・ Rational ClearQuest
・ Rational conformal field theory
・ Rational consequence relation
Rational data type
・ Rational dependence
・ Rational depression
・ Rational design
・ Rational difference equation
・ Rational DOORS
・ Rational economic exchange
・ Rational egoism
・ Rational emotive behavior therapy
・ Rational expectations
・ Rational fideism
・ Rational function
・ Rational Functional Tester
・ Rational herding
・ Rational homotopy theory


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Rational data type : ウィキペディア英語版
Rational data type
Some programming languages provide a built-in (primitive) rational data type to represent rational numbers like 1/3 and -11/17 without rounding, and to do arithmetic on them. Examples are the ratio type of Common Lisp, and analogous types provided by most languages for algebraic computation, such as Mathematica and Maple. Many languages that do not have a built-in rational type still provide it as a library-defined type.
== Representation ==
A variable or value of that type is usually represented as a fraction ''m''/''n'' where ''m'' and ''n'' are two integer numbers, either with a fixed or arbitrary precision. Depending on the language, the denominator ''n'' may be constrained to be non-zero, and the two numbers may be kept in reduced form (without any common divisors except 1).
Languages that support a rational data type usually provide special syntax for building such values, and also extend the basic arithmetic operations ('+', '−', '×', '/', integer powers) and comparisons ('=', '<', '>', '≤') to act on them — either natively or through operator overloading facilities provided by the language. These operations may be translated by the compiler into a sequence of integer machine instructions, or into library calls. Support may also extend to other operations, such as formatting, rounding to an integer or floating point value, etc.. As in mathematics, those languages often interpret an integer value as equivalent to a rational value with a unit denominator.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Rational data type」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.